<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<div role="grid">
  <div role="row" id="row0">
  </div>
</div>

<canvas role="treegrid">
  <select role="row" id="row1">
</canvas>

<script>
function axElementById(id) {
    return accessibilityController.accessibleElementById(id);
}

test(function(t) {
    var row = document.getElementById("row0");
    var cell = new AccessibleNode();
    cell.role = "gridcell";
    row.accessibleNode.appendChild(cell);
    var ax = axElementById("row0");
    var axChild = ax.childAtIndex(0);
    assert_equals(axChild.role, "AXRole: AXCell");
}, "An ARIA cell without a layout object does not crash");

test(function(t) {
    var ax = axElementById("row1");
    assert_equals(ax.role, "AXRole: AXRow");
}, "An ARIA row in a select in a canvas does not crash");

</script>
